<template>
	<view
		:style="themeColor"
		style="overflow-x: hidden;"
	>
		<view class="page">
			<view
				class="flex align-stretch benben-position-layout flex myTrack_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex align-center justify-between flex-sub myTrack_fd0_0'>
					<view
						class='flex align-center myTrack_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  myTrack_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex align-center'>
						<text
							class='myTrack_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>我的足迹</text>
					</view>
					<view
						class='flex align-center justify-end myTrack_fd0_0_c0'
						style="opacity: 0;"
					>
						<!-- @tap.stop="switchTypeFunc()" -->
						<text
							class='myTrack_fd0_0_c2_c0'
							v-if=" is_edit===false"
						>编辑</text><text
							class='myTrack_fd0_0_c2_c0'
							v-if=" is_edit===true"
						>完成</text>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<benben-popup
				v-model="popupShow1691652180194"
				:mask="true"
				:mask-close-able="true"
				mode='center'
			>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center">
					<benben-calendar-diy
						mode='range'
						year-arrow-color='#666666'
						month-arrow-color='#666666'
						start-text=' '
						end-text=' '
						active-bg-color='rgba(45, 175, 65, 1)'
						range-bg-color='rgba(45, 175, 65, 0.5)'
						:change-title='true'
						:change-year='true'
						:change-month='true'
						class='myTrack_fd1_0'
						@change="queryListFunc()"
						:start-time.sync="start_time"
						:end-time.sync="end_time"
					></benben-calendar-diy>
				</view>

				<!---flex布局flex布局结束-->

			</benben-popup>
			<!---flex布局flex布局开始-->
			<!-- <view class="flex benben-flex-layout flex-wrap align-center myTrack_flex_2">
				<view
					class='flex flex-wrap align-center justify-center myTrack_fd2_0'
					@tap.stop="popupShow1691652180194=true"
				>
					<text
						class='flex-sub myTrack_fd2_0_c0'
						v-if="start_time==''"
					>开始时间</text><text
						class='flex-sub myTrack_fd2_0_c0'
						v-if="start_time!=''"
					>{{start_time}}</text>
					<image
						class='myTrack_fd2_0_c1'
						mode="aspectFit"
						:src='STATIC_URL+"288.png"'
					></image>
				</view>
				<text class='myTrack_fd2_1'>至</text>
				<view
					class='flex flex-wrap align-center justify-center myTrack_fd2_0'
					@tap.stop="popupShow1691652180194=true"
				>
					<text
						class='flex-sub myTrack_fd2_0_c0'
						v-if="end_time==''"
					>结束时间</text><text
						class='flex-sub myTrack_fd2_0_c0'
						v-if="end_time!=''"
					>{{end_time}}</text>
					<image
						class='myTrack_fd2_0_c1'
						mode="aspectFit"
						:src='STATIC_URL+"288.png"'
					></image>
				</view>
			</view> -->
			<!---flex布局flex布局结束-->
			<benben-goods-footprint
				:loading="listDataLoading"
				time-format='MM月DD日'
				price-before='￥'
				class='myTrack_flex_footprint_3'
				:goods-list.sync='listData'
				:goods-id.sync='shop_id'
				:isEditor.sync="isEditor"
				v-model='detele_id'
				@handleDel="deleteFootprintFunc()"
				@handleGoods="jumpFunc()"
			>
			</benben-goods-footprint>

			<view
				style="font-family: Source Han Sans CN, Source Han Sans CN;"
				class="btn_box"
				v-if="!isEditor"
			>
				<button @tap.stop="isEditor=!isEditor">编辑</button>
			</view>
			<!---订单列表flex布局开始-->
			<view
				class="flex flex-wrap align-center justify-center benben-flex-layout myTrack_flex_4"
				v-if=" dataList.length<=0 && dataGoodsList.length>0"
			>
				<image
					class='myTrack_fd4_0'
					mode="aspectFit"
					:src='STATIC_URL+"214.png"'
				></image>
				<text
					class='myTrack_fd4_1'
					style="font-family: Source Han Sans CN, Source Han Sans CN;"
				>猜你喜欢</text>
				<image
					class='myTrack_fd4_0'
					mode="aspectFit"
					:src='STATIC_URL+"215.png"'
				></image>
			</view>

			<!---订单列表flex布局结束-->
			<!---flex布局flex布局开始-->
			<view
				class="flex flex-direction flex-wrap align-stretch benben-flex-layout myTrack_flex_5"
				v-if=" dataList.length<=0 && dataGoodsList.length>0"
			>
				<view class='flex flex-wrap align-center justify-between myTrack_fd5_0'>
					<template v-for='(item,key0) in dataGoodsList'>
						<view
							class='flex flex-direction flex-wrap align-stretch myTrack_fd5_0_c0'
							@tap.stop="handleJumpDiy"
							data-type="navigateTo"
							:data-url="`/?id=${item.aid}`"
							:key='key0'
						>
							<image
								class='myTrack_fd5_0_c0_c0'
								mode="aspectFill"
								:src='item.thumb'
							></image>
							<text
								class='myTrack_fd5_0_c0_c1'
								style="font-family: Source Han Sans CN, Source Han Sans CN;"
							>{{item.name}}</text>
							<view class='flex flex-wrap align-center myTrack_fd5_0_c0_c2'>
								<text
									class='myTrack_fd5_0_c0_c2_c0'
									style="font-family: Source Han Sans CN, Source Han Sans CN;"
								>销量</text>
								<text
									class='myTrack_fd5_0_c0_c2_c1'
									style="font-family: Source Han Sans CN, Source Han Sans CN;"
								>{{item.sales_sum}}</text>
							</view>
							<view class='flex flex-wrap align-center myTrack_fd5_0_c0_c3'>
								<text
									class='myTrack_fd5_0_c0_c3_c0'
									style="font-family: Source Han Sans CN, Source Han Sans CN;"
								>¥</text>
								<text class=' myTrack_fd5_0_c0_c3_c1'>
									<text
										class=' myTrack_price1_fd5_0_c0_c3_c1'
										style="font-family: Source Han Sans CN, Source Han Sans CN;"
									>{{ item.shop_price | frontPrice }}</text>
									<text
										class=' myTrack_price2_fd5_0_c0_c3_c1'
										style="font-family: Source Han Sans CN, Source Han Sans CN;"
									>{{ item.shop_price | laterPrice }}</text>
								</text>
								<text
									class='myTrack_fd5_0_c0_c3_c2'
									style="font-family: Source Han Sans CN, Source Han Sans CN;"
								>{{item.market_price}}</text>
							</view>
						</view>
					</template>
					<fu-empty
						:pagingListLoadedAll="pagingListLoadedAll"
						:pagingListNoListData="pagingListNoListData"
						:listDataLength="listDataLength"
						:isLoadInit="isLoadInit"
					></fu-empty>
				</view>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import { validate } from '@/common/utils/validate.js'
	import { loduleMixin } from './loduleMixin'
	export default {
		components: {},
		mixins: [pagingList, loduleMixin, ],

		data() {
			return {
				"popupShow1691652180194": false,
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"dataList": [],
				"is_edit": false,
				"shop_id": "",
				"detele_id": "",
				"true": true,
				"falses": false,
				"start_time": "",
				"end_time": "",
				"dataGoodsList": [],
				isEditor: false,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			// this.getGoosListFunc()
			// this.queryListFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.queryListFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//切换编辑状态
			switchTypeFunc() {
				if (this.is_edit === false) {
					this.is_edit = this.true;
					return
				}
				if (this.is_edit === true) {
					this.is_edit = this.falses;
					return
				}
			},
			//获取足迹列表
			async queryListFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.get(global.apiUrls.post64145c1253b3e, {
					start_time: this.start_time,
					end_time: this.end_time
				});

				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data
				this.popupShow1691652180194 = false;
			},
			//点击商品
			jumpFunc() {
				uni.navigateTo({ url: "/pages/grzx/merchanDisedetails/merchanDisedetails?id=" + this.shop_id })
			},
			//获取为你推荐
			getGoosListFunc() {
				this.minixPagingListsApi = global.apiUrls.post64184ac1cafc3;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = { goods_type: '2' }
				this.listData = [];
				this.dataGoodsList = this.listData;
				this.pagingListToggle();
			},
			//删除足迹
			async deleteFootprintFunc() {
				//请求方法
				//数据验证
				let data64145e74b3a92 = await this.$api.post(`/${this.apiFix}/6551cff8d7785`, {
					foot_ids: this.detele_id
				});

				if (data64145e74b3a92.data.code != 1) {
					this.$message.info(data64145e74b3a92.data.msg);
					return
				}
				this.$message.info(data64145e74b3a92.data.msg)
				this.resetlistData()
				this.isEditor = false;
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.myTrack_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.myTrack_fd0_0_c2_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.myTrack_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.myTrack_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.myTrack_fd0_0_c0 {
		width: 180rpx;
	}

	.myTrack_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.myTrack_fd1_0 {
		background: #ffffff;
		width: 640rpx;
		border-radius: 16rpx;
		padding: 12rpx 012rpx 012rpx 012rpx;
	}

	.myTrack_flex_2 {
		padding: 24rpx 32rpx 24rpx 32rpx;
	}

	.myTrack_fd2_1 {
		font-size: 24rpx;
		margin: 0rpx 24rpx 0rpx 24rpx;
	}

	.myTrack_fd2_0_c1 {
		width: 30rpx;
		height: 30rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 4rpx 0rpx 0rpx 0rpx;
	}

	.myTrack_fd2_0_c0 {
		text-align: center;
		font-size: 24rpx;
	}

	.myTrack_fd2_0 {
		border: 1px solid rgba(191, 191, 191, 1);
		width: 245rpx;
		height: 56rpx;
		border-radius: 8rpx;
		padding: 0rpx 20rpx 0rpx 0rpx;
	}

	.myTrack_flex_footprint_3 {
		--checked-active: var(--benbenFontColor5);
		font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;
	}

	.myTrack_flex_4 {
		padding: 51rpx 0rpx 33rpx 0rpx;
	}

	.myTrack_fd4_1 {
		font-size: 40rpx;
		font-weight: 600;
		color: #333;
		margin: 0rpx 24rpx 0rpx 24rpx;
	}

	.myTrack_fd4_0 {
		width: 138rpx;
		height: 28rpx;
	}

	.myTrack_flex_5 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.myTrack_fd5_0_c0_c3_c2 {
		color: #B2B2B2;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		text-decoration: line-through;
		margin: 0rpx 0rpx -8rpx 11rpx;
	}

	.myTrack_price2_fd5_0_c0_c3_c1 {
		font-size: 22rpx;
	}

	.myTrack_price1_fd5_0_c0_c3_c1 {
		font-size: 32rpx;
		font-weight: 700;
	}

	.myTrack_fd5_0_c0_c3_c1 {
		color: #ff5536;
		font-weight: 700;
		font-size: 20rpx;
		line-height: 30rpx;
		margin: 6rpx 0rpx 0rpx 0rpx;
	}

	.myTrack_fd5_0_c0_c3_c0 {
		color: #EF3A3A;
		font-weight: 600;
		font-size: 20rpx;
	}

	.myTrack_fd5_0_c0_c3 {
		margin: 0rpx 20rpx 0rpx 20rpx;
	}

	.myTrack_fd5_0_c0_c2_c1 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.myTrack_fd5_0_c0_c2_c0 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.myTrack_fd5_0_c0_c2 {
		margin: 16rpx 20rpx 16rpx 20rpx;
	}

	.myTrack_fd5_0_c0_c1 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 40rpx;
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 24rpx 20rpx 0rpx 20rpx;
	}

	.myTrack_fd5_0_c0_c0 {
		width: 346rpx;
		height: 346rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}

	.myTrack_fd5_0_c0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 344rpx;
		padding: 0rpx 0rpx 24rpx 0rpx;
		box-shadow: 0rpx 3rpx 30rpx #E8E8E8;
		margin: 0rpx 0rpx 20rpx 0rpx;

	}

	.myTrack_fd5_0 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.btn_box {
		height: calc(88rpx + 64rpx + var(--window-bottom));

		button {
			position: fixed;
			left: 50%;
			transform: translateX(-50%);
			bottom: calc(32rpx + var(--window-bottom));
			width: 690rpx;
			height: 88rpx;
			background: linear-gradient(90deg, #BB4834 0%, #96301D 100%);
			border-radius: 44rpx;
			font-size: 36rpx;
			font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;
			font-weight: 400;
			color: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>